package cz.muni.fi.cassandra.Playorm.entities;

import com.alvazan.orm.api.base.anno.NoSqlEntity;
import com.alvazan.orm.api.base.anno.NoSqlId;
import com.alvazan.orm.api.base.anno.NoSqlIndexed;
import com.alvazan.orm.api.base.anno.NoSqlManyToOne;

@NoSqlEntity
public class TweetPlayorm {

	@NoSqlId
    private String id;

    @NoSqlIndexed
    private String body;
    
    @NoSqlManyToOne
    private UserPlayorm author;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public UserPlayorm getAuthor() {
		return author;
	}

	public void setAuthor(UserPlayorm author) {
		this.author = author;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof TweetPlayorm)) {
			return false;
		}
		TweetPlayorm other = (TweetPlayorm) object;
		if ((this.id == null) || (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "TweetPlayorm [id=" + id + ", body=" + body + ", author="
				+ author + "]";
	}
	
    
    
}
